/*
 * Copyright 2012 ITC Tsinghua University. All Rights Reserved.
 */
package cn.edu.tsinghua.cic.ccss.qo;

import org.forten.core.qo.GeneralQo;
import org.forten.utils.common.StringUtil;
import org.forten.utils.security.MD5Util;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

/**
 * 
 * 
 * @author <a href="mailto:du_yi@bbn.cn">Duyi</a>
 * 
 * @since 2012-5-16
 */
@Component("courseSelectionQo")
@Scope("prototype")
public class CourseSelectionQo implements GeneralQo {
	private String cardNum;
	private String cardNumMD5;
	private String cadreName;
	private String cadreNameMD5;

	private String courseNum;
	private String courseName;
	
	private String start;
	private String end;

	public String getCardNum() {
		return cardNum;
	}

	public void setCardNum(String cardNum) {
		if (StringUtil.hasText(cardNum)) {
			this.cardNumMD5 = MD5Util.encrypt(cardNum);
		} else {
			this.cardNumMD5 = null;
		}
		this.cardNum = cardNum;
	}

	public String getCourseNum() {
		return courseNum;
	}

	public void setCourseNum(String courseNum) {
		this.courseNum = courseNum;
	}

	public String getCardNumMD5() {
		return cardNumMD5;
	}

	public String getCadreName() {
		return cadreName;
	}

	public void setCadreName(String cadreName) {
		if (StringUtil.hasText(cadreName)) {
			this.cadreNameMD5 = MD5Util.encrypt(cadreName);
		} else {
			this.cadreNameMD5 = null;
		}
		this.cadreName = cadreName;
	}

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getCadreNameMD5() {
		return cadreNameMD5;
	}

	public String getStart() {
		return start;
	}

	public void setStart(String start) {
		this.start = start;
	}

	public String getEnd() {
		return end;
	}

	public void setEnd(String end) {
		this.end = end;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see org.forten.core.qo.QueryObject#clean()
	 */
	@Override
	public void clean() {
		this.cadreName = null;
		this.cadreNameMD5 = null;
		this.cardNum = null;
		this.cardNumMD5 = null;
		this.courseName = null;
		this.courseNum = null;
	}

}
